package com.server.questionbank.snframe.service.OllamaService.KnowledgeBaseService.TextEmbeddingService;

import reactor.core.publisher.Mono;

import java.util.Set;

public interface TextEmbeddingService {
    // 文本向量化
    public Mono<float[]> generateEmbedding(String text) throws Exception;
    // 余弦相似度计算
    public float cosineSimilarity(float[] vec1, float[] vec2);

    // 计算关键词匹配分数（支持传入预定义关键词）
    public float calculateKeywordScore(String correctAnswer, String userAnswer);

    // 分词器
    public Set<String> extractKeywords(String text);
}
